// TypeScript的引用数据类型（数组、函数、对象）
/* (1)数组 => 变量名：数据类型 [] */
var arr1 = ["Vue3", "Spring Boot", "MySQL"];
var arr2 = [95, 98, 92];
// 联合类型：可以在数据类型中，通过 ‘|’ 进行联合
var arr3 = ["前端", 95, "后端", 98];
console.log("数组类型演示:");
console.log(' ', arr1, '\n ', arr2, '\n ', arr3, '\n');
/* (2)对象 =>  */
// 1.变量名：object = {} (不常用)
var obj1 = {
    name: 'Mary',
    age: 18
};
var obj3 = {
    name: 'Mark',
    age: 20
};
var obj4 = {
    name: 'Amy',
    age: 19,
    height: 175
};
var obj5 = {
    name: 'Jhon',
    age: 14,
    height: 180
};
console.log("对象类型演示:");
console.log(' ', obj1, '\n ', obj3, '\n ', obj4, '\n ', obj5, '\n');
/* 联合类型 */
var lh1 = ['zh', 234, true];
console.log("联合数组：", lh1);
var lh2 = 56;
console.log("联合变量：", lh2);
lh2 = 'zhe';
console.log("联合变量：", lh2, '\n');
/* 字面量类型 */
var p1 = 'zs'; // p1只能等于‘zs’
console.log("字面量类型1：", p1);
var p2 = 55; // p2等于55或者99
console.log("字面量类型2：", p2);
p2 = 99;
console.log("字面量类型2：", p2);
// p2 = 45  编译错误
var p3 = 55;
console.log("字面量类型3：", p3);
p3 = 'zhw';
console.log("字面量类型3：", p3, '\n');
